home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsIDocShell.idl < prev    next >
Text File  |  2006-05-08  |  15KB  |  408 lines

  1. /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * ***** BEGIN LICENSE BLOCK *****
  4.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5.  *
  6.  * The contents of this file are subject to the Mozilla Public License Version
  7.  * 1.1 (the "License"); you may not use this file except in compliance with
  8.  * the License. You may obtain a copy of the License at
  9.  * http://www.mozilla.org/MPL/
  10.  *
  11.  * Software distributed under the License is distributed on an "AS IS" basis,
  12.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13.  * for the specific language governing rights and limitations under the
  14.  * License.
  15.  *
  16.  * The Original Code is the Mozilla browser.
  17.  *
  18.  * The Initial Developer of the Original Code is
  19.  * Netscape Communications, Inc.
  20.  * Portions created by the Initial Developer are Copyright (C) 1999
  21.  * the Initial Developer. All Rights Reserved.
  22.  *
  23.  * Contributor(s):
  24.  *   Travis Bogard <travis@netscape.com>
  25.  *   Steve Clark <buster@netscape.com>
  26.  *
  27.  * Alternatively, the contents of this file may be used under the terms of
  28.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  29.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  30.  * in which case the provisions of the GPL or the LGPL are applicable instead
  31.  * of those above. If you wish to allow use of your version of this file only
  32.  * under the terms of either the GPL or the LGPL, and not to allow others to
  33.  * use your version of this file under the terms of the MPL, indicate your
  34.  * decision by deleting the provisions above and replace them with the notice
  35.  * and other provisions required by the GPL or the LGPL. If you do not delete
  36.  * the provisions above, a recipient may use your version of this file under
  37.  * the terms of any one of the MPL, the GPL or the LGPL.
  38.  *
  39.  * ***** END LICENSE BLOCK ***** */
  40.  
  41. #include "nsISupports.idl"
  42.  
  43. %{ C++
  44. class nsPresContext;
  45. class nsIPresShell;
  46. %}
  47.  
  48. /**
  49.  * The nsIDocShell interface.
  50.  */
  51.  
  52. [ptr] native nsPresContext(nsPresContext);
  53. [ptr] native nsIPresShell(nsIPresShell);
  54.  
  55. interface nsIURI;
  56. interface nsIContentViewer;
  57. interface nsIURIContentListener;
  58. interface nsIChromeEventHandler;
  59. interface nsIDocShellLoadInfo;
  60. interface nsIDocumentCharsetInfo;
  61. interface nsIWebNavigation;
  62. interface nsISimpleEnumerator;
  63. interface nsIInputStream;
  64. interface nsIRequest;
  65. interface nsISHEntry;
  66. interface nsILayoutHistoryState;
  67. interface nsISecureBrowserUI;
  68.  
  69. [scriptable, uuid(9f0c7461-b9a4-47f6-b88c-421dce1bce66)]
  70. interface nsIDocShell : nsISupports
  71. {
  72.   /**
  73.    * Loads a given URI.  This will give priority to loading the requested URI
  74.    * in the object implementing    this interface.  If it can't be loaded here
  75.    * however, the URL dispatcher will go through its normal process of content
  76.    * loading.
  77.    *
  78.    * @param uri        - The URI to load.
  79.    * @param loadInfo   - This is the extended load info for this load.  This
  80.    *                     most often will be null, but if you need to do 
  81.    *                     additional setup for this load you can get a loadInfo
  82.    *                     object by calling createLoadInfo.  Once you have this
  83.    *                     object you can set the needed properties on it and
  84.    *                     then pass it to loadURI.
  85.    * @param aLoadFlags - Flags to modify load behaviour. Flags are defined
  86.    *                     in nsIWebNavigation.
  87.    */
  88.   [noscript]void loadURI(in nsIURI uri,
  89.                          in nsIDocShellLoadInfo loadInfo,
  90.                          in unsigned long aLoadFlags,
  91.                          in boolean firstParty);
  92.  
  93.   /**
  94.    * Loads a given stream. This will give priority to loading the requested
  95.    * stream in the object implementing this interface. If it can't be loaded
  96.    * here however, the URL dispatched will go through its normal process of
  97.    * content loading.
  98.    *
  99.    * @param aStream         - The input stream that provides access to the data
  100.    *                          to be loaded.  This must be a blocking, threadsafe
  101.    *                          stream implementation.
  102.    * @param aURI            - The URI representing the stream, or null.
  103.    * @param aContentType    - The type (MIME) of data being loaded (empty if unknown).
  104.    * @param aContentCharset - The charset of the data being loaded (empty if unknown).
  105.    * @param aLoadInfo       - This is the extended load info for this load.  This
  106.    *                          most often will be null, but if you need to do 
  107.    *                          additional setup for this load you can get a
  108.    *                          loadInfo object by calling createLoadInfo.  Once
  109.    *                          you have this object you can set the needed 
  110.    *                          properties on it and then pass it to loadStream.
  111.    */
  112.   [noscript]void loadStream(in nsIInputStream aStream,
  113.                             in nsIURI aURI,
  114.                             in ACString aContentType,
  115.                             in ACString aContentCharset,
  116.                             in nsIDocShellLoadInfo aLoadInfo);
  117.  
  118.   const long INTERNAL_LOAD_FLAGS_NONE               = 0x0;
  119.   const long INTERNAL_LOAD_FLAGS_INHERIT_OWNER      = 0x1;
  120.   const long INTERNAL_LOAD_FLAGS_DONT_SEND_REFERRER = 0x2;
  121.  
  122.   /**
  123.    * Loads the given URI.  This method is identical to loadURI(...) except
  124.    * that its parameter list is broken out instead of being packaged inside
  125.    * of an nsIDocShellLoadInfo object...
  126.    *
  127.    * @param aURI            - The URI to load.
  128.    * @param aReferrer       - Referring URI
  129.    * @param aOwner          - Owner (security principal) 
  130.    * @param aInheritOwner   - Flag indicating whether the owner of the current
  131.    *                          document should be inherited if aOwner is null.
  132.    * @param aStopActiveDoc  - Flag indicating whether loading the current
  133.    *                          document should be stopped.
  134.    * @param aWindowTarget   - Window target for the load.
  135.    * @param aTypeHint       - A hint as to the content-type of the resulting
  136.    *                          data.  May be null or empty if no hint.
  137.    * @param aPostDataStream - Post data stream (if POSTing)
  138.    * @param aHeadersStream  - Stream containing "extra" request headers...
  139.    * @param aLoadFlags      - Flags to modify load behaviour. Flags are defined
  140.    *                          in nsIWebNavigation.
  141.    * @param aSHEntry        - Active Session History entry (if loading from SH)
  142.    */
  143.   [noscript]void internalLoad(in nsIURI aURI,
  144.                               in nsIURI aReferrer,
  145.                               in nsISupports aOwner,
  146.                               in PRUint32 aFlags,
  147.                               in wstring aWindowTarget,
  148.                               in string aTypeHint,
  149.                               in nsIInputStream aPostDataStream,
  150.                               in nsIInputStream aHeadersStream,
  151.                               in unsigned long aLoadFlags,
  152.                               in nsISHEntry aSHEntry,
  153.                               in boolean firstParty,
  154.                               out nsIDocShell aDocShell,
  155.                               out nsIRequest aRequest);
  156.  
  157.   /**
  158.    * Creates a DocShellLoadInfo object that you can manipulate and then pass
  159.    * to loadURI.
  160.    */
  161.   void createLoadInfo(out nsIDocShellLoadInfo loadInfo);
  162.  
  163.   /**
  164.    * Reset state to a new content model within the current document and the document
  165.    * viewer.  Called by the document before initiating an out of band document.write().
  166.    */
  167.   void prepareForNewContentModel();
  168.  
  169.   /**
  170.    * For editors and suchlike who wish to change the URI associated with the
  171.    * document. Note if you want to get the current URI, use the read-only
  172.    * property on nsIWebNavigation.
  173.    */ 
  174.   void setCurrentURI(in nsIURI aURI);
  175.  
  176.   /**
  177.    * Notify the associated content viewer and all child docshells that they are
  178.    * about to be hidden.  If |isUnload| is true, then the document is being
  179.    * unloaded as well.
  180.    */
  181.   [noscript] void firePageHideNotification(in boolean isUnload);
  182.  
  183.   /**
  184.    * Presentation context for the currently loaded document.  This may be null.
  185.    */
  186.   [noscript] readonly attribute nsPresContext presContext;
  187.  
  188.   /**
  189.    * Presentation shell for the currently loaded document.  This may be null.
  190.    */
  191.   [noscript] readonly attribute nsIPresShell presShell;
  192.  
  193.   /**
  194.    * Presentation shell for the oldest document, if this docshell is
  195.    * currently transitioning between documents.
  196.    */
  197.   [noscript] readonly attribute nsIPresShell eldestPresShell;
  198.  
  199.   /**
  200.    * Content Viewer that is currently loaded for this DocShell.  This may
  201.    * change as the underlying content changes.
  202.    */
  203.   readonly attribute nsIContentViewer contentViewer;
  204.  
  205.   /**
  206.    * This attribute allows chrome to tie in to handle DOM events that may
  207.    * be of interest to chrome.
  208.    */
  209.   attribute nsIChromeEventHandler chromeEventHandler;
  210.  
  211.   /**
  212.    * The document charset info.  This is used by a load to determine priorities
  213.    * for charset detection etc.
  214.    */
  215.   attribute nsIDocumentCharsetInfo documentCharsetInfo;
  216.  
  217.   /**
  218.    * Whether to allow plugin execution
  219.    */
  220.   attribute boolean allowPlugins;
  221.  
  222.   /**
  223.    * Whether to allow Javascript execution
  224.    */
  225.   attribute boolean allowJavascript;
  226.  
  227.   /**
  228.    * Attribute stating if refresh based redirects can be allowed
  229.    */
  230.   attribute  boolean allowMetaRedirects;
  231.  
  232.   /**
  233.    * Attribute stating if it should allow subframes (framesets/iframes) or not
  234.    */
  235.   attribute boolean allowSubframes;
  236.  
  237.   /**
  238.    * Attribute stating whether or not images should be loaded.
  239.    */
  240.   attribute boolean allowImages;
  241.  
  242.   /**
  243.    * Get an enumerator over this docShell and its children.
  244.    *
  245.    * @param aItemType  - Only include docShells of this type, or if typeAll,
  246.    *                     include all child shells.
  247.    *                     Uses types from nsIDocShellTreeItem.
  248.    * @param aDirection - Whether to enumerate forwards or backwards.
  249.    */
  250.  
  251.   const long ENUMERATE_FORWARDS  = 0;
  252.   const long ENUMERATE_BACKWARDS = 1;
  253.  
  254.   nsISimpleEnumerator getDocShellEnumerator(in long aItemType,
  255.                                             in long aDirection);
  256.  
  257.   /**
  258.    * The type of application that created this window
  259.    */
  260.   const unsigned long APP_TYPE_UNKNOWN  = 0;
  261.   const unsigned long APP_TYPE_MAIL     = 1;
  262.   const unsigned long APP_TYPE_EDITOR   = 2;
  263.  
  264.   attribute unsigned long appType;
  265.  
  266.   /**
  267.    * certain dochshells (like the message pane)
  268.    * should not throw up auth dialogs
  269.    * because it can act as a password trojan
  270.    */
  271.   attribute boolean allowAuth;
  272.  
  273.   /**
  274.    * Set/Get the document scale factor.  When setting this attribute, a
  275.    * NS_ERROR_NOT_IMPLEMENTED error may be returned by implementations
  276.    * not supporting zoom.  Implementations not supporting zoom should return
  277.    * 1.0 all the time for the Get operation.  1.0 by the way is the default
  278.    * of zoom.  This means 100% of normal scaling or in other words normal size
  279.    * no zoom. 
  280.    */
  281.   attribute float zoom;
  282.  
  283.   /*
  284.    * XXX Comment here!
  285.    */
  286.   attribute long marginWidth;
  287.  
  288.   /*
  289.    * XXX Comment here!
  290.    */
  291.   attribute long marginHeight;
  292.  
  293.   /*
  294.    * Tells the DocShell that it now has focus or has lost focus
  295.    */
  296.   attribute boolean hasFocus;
  297.  
  298.   /*
  299.    * Tells the docshell whether the canvas should have focus
  300.    */
  301.   attribute boolean canvasHasFocus;
  302.  
  303.   /*
  304.    * Tells the docshell to offer focus to its tree owner.
  305.    * This is currently only necessary for embedding chrome.
  306.    */
  307.   void tabToTreeOwner(in boolean forward,
  308.                       out boolean tookFocus);
  309.  
  310.   /**
  311.    * Current busy state for DocShell
  312.    */
  313.   const unsigned long BUSY_FLAGS_NONE             = 0;
  314.   const unsigned long BUSY_FLAGS_BUSY             = 1;
  315.   const unsigned long BUSY_FLAGS_BEFORE_PAGE_LOAD = 2;
  316.   const unsigned long BUSY_FLAGS_PAGE_LOADING     = 4;
  317.  
  318.   /**
  319.    * Load commands for the document 
  320.    */
  321.   const unsigned long LOAD_CMD_NORMAL  = 0x1; // Normal load
  322.   const unsigned long LOAD_CMD_RELOAD  = 0x2; // Reload
  323.   const unsigned long LOAD_CMD_HISTORY = 0x4; // Load from history
  324.  
  325.   readonly attribute unsigned long busyFlags;
  326.  
  327.   /* 
  328.    * attribute to access the loadtype  for the document
  329.    */
  330.   attribute unsigned long  loadType;
  331.  
  332.   /*
  333.    * returns true if the docshell is being destroyed, false otherwise
  334.    */
  335.   boolean isBeingDestroyed();
  336.  
  337.   /*
  338.    * Returns true if the docshell is currently executing the onLoad Handler
  339.    */
  340.   readonly attribute boolean isExecutingOnLoadHandler;
  341.  
  342.   attribute nsILayoutHistoryState layoutHistoryState;
  343.  
  344.   readonly attribute boolean shouldSaveLayoutState;
  345.  
  346.   /**
  347.    * The SecureBrowserUI object for this docshell.  This is set by XUL
  348.    * <browser> or nsWebBrowser for their root docshell.
  349.    */
  350.   attribute nsISecureBrowserUI securityUI;
  351.  
  352.   /**
  353.    * Cancel the XPCOM timers for each meta-refresh URI in this docshell,
  354.    * and this docshell's children, recursively. The meta-refresh timers can be
  355.    * restarted using resumeRefreshURIs().  If the timers are already suspended,
  356.    * this has no effect.
  357.    */
  358.   void suspendRefreshURIs();
  359.  
  360.   /**
  361.    * Restart the XPCOM timers for each meta-refresh URI in this docshell,
  362.    * and this docshell's children, recursively.  If the timers are already
  363.    * running, this has no effect.
  364.    */
  365.   void resumeRefreshURIs();
  366.  
  367.   /**
  368.    * Begin firing WebProgressListener notifications for restoring a page
  369.    * presentation. |viewer| is the content viewer whose document we are
  370.    * starting to load.  If null, it defaults to the docshell's current content
  371.    * viewer, creating one if necessary.  |top| should be true for the toplevel
  372.    * docshell that is being restored; it will be set to false when this method
  373.    * is called for child docshells.  This method will post an event to
  374.    * complete the simulated load after returning to the event loop.
  375.    */
  376.   void beginRestore(in nsIContentViewer viewer, in boolean top);
  377.  
  378.   /**
  379.    * Finish firing WebProgressListener notifications and DOM events for
  380.    * restoring a page presentation.  This should only be called via
  381.    * beginRestore().
  382.    */
  383.   void finishRestore();
  384.  
  385.   /* Track whether we're currently restoring a document presentation. */
  386.   readonly attribute boolean restoringDocument;
  387.  
  388.   /* attribute to access whether error pages are enabled */
  389.   attribute boolean useErrorPages;
  390.  
  391.   /**
  392.    * Keeps track of the previous SHTransaction index and the current
  393.    * SHTransaction index at the time that the doc shell begins to load.
  394.    * Used for ContentViewer eviction.
  395.    */
  396.   readonly attribute long previousTransIndex;
  397.   readonly attribute long loadedTransIndex;
  398.  
  399.   /**
  400.    * Notification that entries have been removed from the beginning of a
  401.    * nsSHistory which has this as its rootDocShell.
  402.    *
  403.    * @param numEntries - The number of entries removed
  404.    */
  405.   void historyPurged(in long numEntries);
  406. };
  407.  
  408.